#1.循环打印“人生苦短，我用python。”
"""
while True:
    print('人生苦短，我用python。')
 """
"""
2.while 后加入条件
while 1>0:
    print('人生苦短，我用python。')
"""

#3.数字相加
"""
count = 1
value = count + 1
print=(value)
"""

#count = 1
#count = count + 1
#print(count)

#4. 请通过循环，让count每次循环都+1
"""
count = 1
while count <= 50:
    count = count + 1
    print(count)
"""
#5.请通过循环，1 2 3 。。10
"""
count = 1
while count <= 10:
    print(count)
    count = count + 1
"""

#6.请通过循环，1 2 3 4 5 6 8 9 10
# count = 1
# while count <= 10:
#     if count != 7 :
#         print(count)
#     count = count + 1

# count = 1
# while count <= 10:
#     if count == 7 :
#         pass
#     else:
#         print(count)
#     count = count + 1

#7.关键字：break
# while True:
#     print(666)
#     break #终止当前循环
#     print('结束')

#联系：通过break实现1~10
# count = 1
# while TabError:
#     print(count)
#     if count == 10:
#         break
#     count = count + 1

"""
while True:
    print('你好')
    while True:
        print(666)
        break
"""

#8.关键字：continue
# count = 1
# # while count <= 10:
# #     print(count)
# #     if count == 7:
# #     continue # 本次循环如果遇到continue，则不再继续往下走，而是回到while条件位置
# #     count = count +1

# count = 1
# while count <= 10:
#     if count == 7:
#         count = count + 1
#         continue
#     print(count)
#     count = count +1

#9.while else
"""
count = 1 
while count < 10:
    print(count)
    count = count + 1
else:  #不再满足while后的条件时，出发。或条件=False
    print('Else代码块')

print('结束')
"""